Optimal. Leaf size=170 \[ -\frac{a \left (a^2+6 b^2\right ) \sin ^3(c+d x)}{3 d}+\frac{a \left (a^2+3 b^2\right ) \sin (c+d x)}{d}+\frac{b \left (18 a^2+5 b^2\right ) \sin (c+d x) \cos ^3(c+d x)}{24 d}+\frac{b \left (18 a^2+5 b^2\right ) \sin (c+d x) \cos (c+d x)}{16 d}+\frac{9}{8} a^2 b x+\frac{3 a b^2 \sin ^5(c+d x)}{5 d}+\frac{b^3 \sin (c+d x) \cos ^5(c+d x)}{6 d}+\frac{5 b^3 x}{16} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.214977, antiderivative size = 193, normalized size of antiderivative = 1.14, number of steps used = 8, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {2793, 3023, 2748, 2633, 2635, 8} \[ -\frac{a \left (5 a^2+12 b^2\right ) \sin ^3(c+d x)}{15 d}+\frac{a \left (5 a^2+12 b^2\right ) \sin (c+d x)}{5 d}+\frac{b \left (18 a^2+5 b^2\right ) \sin (c+d x) \cos ^3(c+d x)}{24 d}+\frac{b \left (18 a^2+5 b^2\right ) \sin (c+d x) \cos (c+d x)}{16 d}+\frac{1}{16} b x \left (18 a^2+5 b^2\right )+\frac{b^2 \sin (c+d x) \cos ^4(c+d x) (a+b \cos (c+d x))}{6 d}+\frac{13 a b^2 \sin (c+d x) \cos ^4(c+d x)}{30 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2793
Rule 3023
Rule 2748
Rule 2633
Rule 2635
Rule 8
Rubi steps
\begin{align*} \int \cos ^3(c+d x) (a+b \cos (c+d x))^3 \, dx &=\frac{b^2 \cos ^4(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{6 d}+\frac{1}{6} \int \cos ^3(c+d x) \left (2 a \left (3 a^2+2 b^2\right )+b \left (18 a^2+5 b^2\right ) \cos (c+d x)+13 a b^2 \cos ^2(c+d x)\right ) \, dx\\ &=\frac{13 a b^2 \cos ^4(c+d x) \sin (c+d x)}{30 d}+\frac{b^2 \cos ^4(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{6 d}+\frac{1}{30} \int \cos ^3(c+d x) \left (6 a \left (5 a^2+12 b^2\right )+5 b \left (18 a^2+5 b^2\right ) \cos (c+d x)\right ) \, dx\\ &=\frac{13 a b^2 \cos ^4(c+d x) \sin (c+d x)}{30 d}+\frac{b^2 \cos ^4(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{6 d}+\frac{1}{6} \left (b \left (18 a^2+5 b^2\right )\right ) \int \cos ^4(c+d x) \, dx+\frac{1}{5} \left (a \left (5 a^2+12 b^2\right )\right ) \int \cos ^3(c+d x) \, dx\\ &=\frac{b \left (18 a^2+5 b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac{13 a b^2 \cos ^4(c+d x) \sin (c+d x)}{30 d}+\frac{b^2 \cos ^4(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{6 d}+\frac{1}{8} \left (b \left (18 a^2+5 b^2\right )\right ) \int \cos ^2(c+d x) \, dx-\frac{\left (a \left (5 a^2+12 b^2\right )\right ) \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{5 d}\\ &=\frac{a \left (5 a^2+12 b^2\right ) \sin (c+d x)}{5 d}+\frac{b \left (18 a^2+5 b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}+\frac{b \left (18 a^2+5 b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac{13 a b^2 \cos ^4(c+d x) \sin (c+d x)}{30 d}+\frac{b^2 \cos ^4(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{6 d}-\frac{a \left (5 a^2+12 b^2\right ) \sin ^3(c+d x)}{15 d}+\frac{1}{16} \left (b \left (18 a^2+5 b^2\right )\right ) \int 1 \, dx\\ &=\frac{1}{16} b \left (18 a^2+5 b^2\right ) x+\frac{a \left (5 a^2+12 b^2\right ) \sin (c+d x)}{5 d}+\frac{b \left (18 a^2+5 b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}+\frac{b \left (18 a^2+5 b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac{13 a b^2 \cos ^4(c+d x) \sin (c+d x)}{30 d}+\frac{b^2 \cos ^4(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{6 d}-\frac{a \left (5 a^2+12 b^2\right ) \sin ^3(c+d x)}{15 d}\\ \end{align*}
Mathematica [A] time = 0.328951, size = 159, normalized size = 0.94 \[ \frac{360 a \left (2 a^2+5 b^2\right ) \sin (c+d x)+45 \left (16 a^2 b+5 b^3\right ) \sin (2 (c+d x))+90 a^2 b \sin (4 (c+d x))+1080 a^2 b c+1080 a^2 b d x+80 a^3 \sin (3 (c+d x))+300 a b^2 \sin (3 (c+d x))+36 a b^2 \sin (5 (c+d x))+45 b^3 \sin (4 (c+d x))+5 b^3 \sin (6 (c+d x))+300 b^3 c+300 b^3 d x}{960 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.038, size = 145, normalized size = 0.9 \begin{align*}{\frac{1}{d} \left ({b}^{3} \left ({\frac{\sin \left ( dx+c \right ) }{6} \left ( \left ( \cos \left ( dx+c \right ) \right ) ^{5}+{\frac{5\, \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{4}}+{\frac{15\,\cos \left ( dx+c \right ) }{8}} \right ) }+{\frac{5\,dx}{16}}+{\frac{5\,c}{16}} \right ) +{\frac{3\,a{b}^{2}\sin \left ( dx+c \right ) }{5} \left ({\frac{8}{3}}+ \left ( \cos \left ( dx+c \right ) \right ) ^{4}+{\frac{4\, \left ( \cos \left ( dx+c \right ) \right ) ^{2}}{3}} \right ) }+3\,{a}^{2}b \left ( 1/4\, \left ( \left ( \cos \left ( dx+c \right ) \right ) ^{3}+3/2\,\cos \left ( dx+c \right ) \right ) \sin \left ( dx+c \right ) +3/8\,dx+3/8\,c \right ) +{\frac{{a}^{3} \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.99068, size = 196, normalized size = 1.15 \begin{align*} -\frac{320 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{3} - 90 \,{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} b - 192 \,{\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} a b^{2} + 5 \,{\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 60 \, d x - 60 \, c - 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{3}}{960 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.0297, size = 324, normalized size = 1.91 \begin{align*} \frac{15 \,{\left (18 \, a^{2} b + 5 \, b^{3}\right )} d x +{\left (40 \, b^{3} \cos \left (d x + c\right )^{5} + 144 \, a b^{2} \cos \left (d x + c\right )^{4} + 10 \,{\left (18 \, a^{2} b + 5 \, b^{3}\right )} \cos \left (d x + c\right )^{3} + 160 \, a^{3} + 384 \, a b^{2} + 16 \,{\left (5 \, a^{3} + 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{2} + 15 \,{\left (18 \, a^{2} b + 5 \, b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.89508, size = 393, normalized size = 2.31 \begin{align*} \begin{cases} \frac{2 a^{3} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac{a^{3} \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac{9 a^{2} b x \sin ^{4}{\left (c + d x \right )}}{8} + \frac{9 a^{2} b x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac{9 a^{2} b x \cos ^{4}{\left (c + d x \right )}}{8} + \frac{9 a^{2} b \sin ^{3}{\left (c + d x \right )} \cos{\left (c + d x \right )}}{8 d} + \frac{15 a^{2} b \sin{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac{8 a b^{2} \sin ^{5}{\left (c + d x \right )}}{5 d} + \frac{4 a b^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac{3 a b^{2} \sin{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} + \frac{5 b^{3} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac{15 b^{3} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac{15 b^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac{5 b^{3} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac{5 b^{3} \sin ^{5}{\left (c + d x \right )} \cos{\left (c + d x \right )}}{16 d} + \frac{5 b^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} + \frac{11 b^{3} \sin{\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} & \text{for}\: d \neq 0 \\x \left (a + b \cos{\left (c \right )}\right )^{3} \cos ^{3}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.3278, size = 203, normalized size = 1.19 \begin{align*} \frac{b^{3} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} + \frac{3 \, a b^{2} \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac{1}{16} \,{\left (18 \, a^{2} b + 5 \, b^{3}\right )} x + \frac{3 \,{\left (2 \, a^{2} b + b^{3}\right )} \sin \left (4 \, d x + 4 \, c\right )}{64 \, d} + \frac{{\left (4 \, a^{3} + 15 \, a b^{2}\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac{3 \,{\left (16 \, a^{2} b + 5 \, b^{3}\right )} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} + \frac{3 \,{\left (2 \, a^{3} + 5 \, a b^{2}\right )} \sin \left (d x + c\right )}{8 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]